body{
    background-color: #ccc;
}

.slide{
    position: relative;
    margin: 100px auto;
    width: 800px;
    height: 500px;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.slide ul{
    margin: 10px 0;
    padding: 0;
    /* 三个li并行的宽度 */
    width: calc(800px * 3);
    transition: all .5s;
}

.slide li{
    float: left;
    /* 与.slide同宽高 */
    width: 800px;
    height: 500px;
    /* 文字垂直居中显示 */
    line-height: 500px;
    font-size: 50px;
}

.slide li:nth-child(1){
    background-color: cyan;
}

.slide li:nth-child(2){
    background-color:deeppink;
}

.slide li:nth-child(3){
    background-color:greenyellow;
}


.slide input[name="button"]{
    display: none;
}

.slide label[for^="button"]{
    position: absolute;
    top: 450px;
    width: 20px;
    height: 20px;
    margin: 0 10px;
    line-height: 20px;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    background: #ccc;
    transition: .3s;
}

.slide label[for="button1"]{
    left: 42%;
}

.slide label[for="button2"]{
    left: 48%;
}

.slide label[for="button3"]{
    left: 54%;
}

#button1:checked ~ul{
    margin-left: 0;
}

#button2:checked ~ul{
    margin-left: -800px;
}

#button3:checked ~ul{
   margin-left: -1600px;
}

#button1:checked ~ label[for="button1"]{
    background: #fff;
}

#button2:checked ~ label[for="button2"]{
    background: #fff;
}

#button3:checked ~ label[for="button3"]{
    background: #fff;
}
















